#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""  
@Project : PythonProject
@File : mail_sender.py.py
@Author : donc
@Time : 2025/5/31 22:33  
@脚本说明 : 
    
"""
import yagmail

def send_phishing_email(sender_email, sender_password, smtp_server, smtp_port, receiver_emails, subject, content):
    try:
        with yagmail.SMTP(
            user=sender_email,
            password=sender_password,
            host=smtp_server,
            port=smtp_port
        ) as yag:
            # 发送邮件给每个收件人
            for receiver_email in receiver_emails:
                yag.send(to=receiver_email, subject=subject, contents=content)
            return True, "邮件发送成功"
    except Exception as e:
        return False, f"邮件发送失败: {str(e)}"